home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1994 June
/
1994-06b.d64
/
grocery lister
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
129 lines
0 rem copyright 1994 compute publications intl ltd - all rights reserved
10 clr:gosub110
20 forx=qto700:ready:pokex,y:next:poke53280,.:poke53281,.
30 dv=8:rem dev # is 8
40 gosub750
50 print"[147]"spc(14)"[159]grocery list
60 [153]"1sys initialize shopping list"rt$"2sys modify grocery list
70 print"3[158] print/display current shopping list"rt$"4[158] exit
80 l[178]17:[141]140:[158]q,.,17:[153]"well?"
90 [146]198,15:[161]x$:[139]x$[179]"1"[176]x$[177]"4"[167]80
100 [145][197](x$)[137]870,150,1000,1240:[137]50
110 [151]49,[194](47):[151]50,[194](48):rt$[178][199](13):dn$[178][199](17):f$[178]"gl.list
120 q=679:ni=450:nc=15:dimx$,a,b,c,d,e,l,px,u,v,x,y,z,z$
130 dimit$(ni),cp%(ni),ct$(nc):return
140 poke781,l:sys59903:return
150 px=1:gosub180
160 print"[147]save file to disk(y/n)":wait198,15:getx$:ifx$="y"then820
170 goto50
180 print"[147]":forx=1tonc:ifct$(x)=""thenct$(x)="none"
190 print""ct$(x):next
200 sysq,13,21:print"return[158] to exit
210 [158]q,7,22:[153]"cursor downsys to move cursor
220 sysq,2,23:print"[158]change category n[158]ame, s[158]elect category
230 x[178]px:e[178]px[171]1:[139]e[178].[167]e[178]15
240 l[178]1:[141]140
250 a[178]e[170]2:b[178]x[170]2:[158]q,.,b:[153]""ct$(x)"wait":[158]q,.,a:[153]""ct$(e)
260 [146]198,15:[161]x$:[139]x$[178]rt$[167][142]
270 [139]x$[178]"n"[167]310
280 [139]x$[178]"s"[167]px[178]x:[141]370:[137]180
290 [139]x$[178]dn$[167]e[178]x:x[178]x[170]1:[139]x[178]16[167]x[178]1
300 [137]240
310 px[178]x:x$[178]"":l[178]1:[141]140:[133]"new name";x$:[139]x$[178]""[167]240
320 x$[178][200](x$,36):ct$(x)[178]x$:l[178]x[170]2:[141]140:[158]q,.,l:[153]ct$(x)
330 l[178]1:[141]140:[153]"initialize food names in category(y/n)?
340 wait198,15:getx$:ifx$="y"then360
350 goto240
360 a=30*(x-1)+1:b=a+29:fory=atob:it$(y)="none":cp%(y)=.:next:goto240
370 a=30*(x-1)+1:b=a+15:c=a+29:v=(40-len(ct$(x)))/2-1
380 print"[147]":sysq,v,1:print"[159]"ct$(x):v=4:u=.:fory=1to30:v=v+1:d=a+y-1
390 ify=16thenu=19:v=5
400 ify>30then420
410 gosub690
420 next:sysq,7,21:print"cursor down[158] to move cursor
430 [158]q,6,22:[153]"returnsys to exit, change nsysame
440 sysq,3,23:print"c[158] to toggle coupon, b[158] to toggle buy
450 y[178]1:e[178]30:[141]620
460 d[178]a[170]y[171]1:[146]198,15:[161]x$:[139]x$[178]rt$[167][142]
470 [139]x$[178]dn$[167]600
480 [139]x$[178]"c"[167]520
490 [139]x$[178]"b"[167]540
500 [139]x$[178]"n"[167]570
510 [137]460
520 [139]cp%(d)[178].[176]cp%(d)[178]2[167]cp%(d)[178]cp%(d)[170]1:[137]560
530 cp%(d)[178]cp%(d)[171]1:[137]560
540 [139]cp%(d)[179]2[167]cp%(d)[178]cp%(d)[170]2:[137]560
550 cp%(d)[178]cp%(d)[171]2
560 [141]690:[141]620:[137]460
570 x$[178]"":l[178]3:[141]140:[133]"new name";x$:[139]x$[178]""[167]590
580 x$[178][200](x$,16):it$(d)[178]x$
590 l[178]3:[141]140:[137]610
600 e[178]y:y[178]y[170]1:[139]y[178]31[167]y[178]1
610 [141]620:[137]460
620 [139]e[177]15[167]v[178]e[171]11:u[178]19:[137]640
630 v[178]e[170]4:u[178].
640 [141]680:[158]q,u,v:[153]""it$(a[170]e[171]1)"
650 ify>15thenv=y-11:u=19:goto670
660 v=y+4:u=.
670 gosub680:sysq,u,v:print""it$(a+y-1)"[146]":return
680 sysq,u,v:print" ":return
690 sysq,u,v:ifcp%(d)=.orcp%(d)=2thenprint" ";:goto710
700 print"$";
710 ifcp%(d)<2thenprint" ";:goto730
720 print"*";
730 ifit$(d)=""thenit$(d)="none"
740 print""it$(d):return
750 print"[147]loading grocery file...
760 [159]2,dv,2,f$[170]",p,r":[160]2:[159]15,dv,15:[132]15,z,z$:[160]15
770 [139]z[178]62[167][142]
780 s$[178]f$[170]",s,r":[159]8,dv,8,s$
790 [129]x[178]1[164]ni:[132]8,it$(x):[132]8,cp%(x):[130]
800 [129]x[178]1[164]nc:[132]8,ct$(x):[130]
810 [160]8:[142]
820 [158]q,.,17:[153]"saving...
830 s$="@0:"+f$+",s,w":open8,dv,8,s$
840 forx=1toni:ifit$(x)=""thenit$(x)="none"
850 print#8,it$(x);rt$;cp%(x):next
860 forx=1tonc:print#8,ct$(x):next:close8:goto50
870 x$="":sysq,.,17:print"c[158]oupons, foods s[158]elected, b[158]oth, or f[158]ile
880 [146]198,15:[161]x$:[139]x$[178]rt$[167]80
890 [139]x$[178]"b"[167][129]y[178]1[164]ni:cp%(y)[178].:[130]:[137]80
900 [139]x$[178]"c"[167]940
910 [139]x$[178]"s"[167]970
920 [139]x$[178]"f"[167][141]110:[137]80
930 [137]880
940 [129]y[178]1[164]ni:[139]cp%(y)[178].[176]cp%(y)[178]2[167]960
950 cp%(y)[178]cp%(y)[171]1
960 [130]:[137]80
970 [129]y[178]1[164]ni:[139]cp%(y)[179]2[167]990
980 cp%(y)[178]cp%(y)[171]2
990 [130]:[137]80
1000 [158]q,.,17:[153]"psysrint or dsysisplay?
1010 wait198,15:getx$:ifx$=rt$then80
1020 ifx$="d"then1140
1030 ifx$="p"then1050
1040 goto1010
1050 l=17:gosub140:sysq,.,17:print"printing...
1060 e[178]1:[159]4,4,0:[129]x[178]1[164]nc:v[178](74[171][195](ct$(x)))[173]2[171]1:a[178].:b[178]30[172](x[171]1)[170]1:c[178]30[172]x
1070 [129]y[178]b[164]c:[139]cp%(y)[179]2[167]1130
1080 d[178]25[171][195](it$(y))
1090 [139]a[178].[167][152]4:[152]4:[152]4,[166]v)" "ct$(x)" wait":[152]4:a[178]1
1100 [139]cp%(y)[178].[176]cp%(y)[178]2[167][152]4," ";:[137]1120
1110 [152]4,"$";
1120 [152]4,it$(y)[166]d);:e[178]e[170]1:[139]e[178]4[167][152]4:e[178]1
1130 [130]:e[178]1:[130]:[152]4:[160]4:[137]50
1140 e[178]1:[129]x[178]1[164]nc:v[178](40[171][195](ct$(x)))[173]2[171]1:a[178].:b[178]30[172](x[171]1)[170]1:c[178]30[172]x
1150 [129]y[178]b[164]c:[139]cp%(y)[179]2[167]1200
1160 d[178]18[171][195](it$(y)):[139]a[178].[167][153]"load"[166]v)"open"ct$(x)"":a[178]1
1170 [139]cp%(y)[178].[176]cp%(y)[178]2[167][153]" ";:[137]1190
1180 [153]"$";
1190 [153]""it$(y)[166]d);:e[178]e[170]1:[139]e[178]3[167][153]:e[178]1
1200 [130]:e[178]1:[139]a[178].[167]1230
1210 [158]q,2,23:[153]"syshit any key to continue, qsys to quit
1220 wait198,15:getx$:ifx$="q"thenx=nc
1230 next:goto50
1240 sysq,.,17:print"really exit?":wait198,15:getx$:ifx$="y"thensys64738
1250 goto80
1260 data32,182,2,134,176,32,182,2,164,176,24,32,240,255,96,32,253,174,32,158
1270 data183,96